# This file is part of MXE.
# See index.html for further information.

PKG             := sox
$(PKG)_IGNORE   :=
$(PKG)_CHECKSUM := d809cab382c7a9d015491c69051a9d1c1a1a44f1
$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_DEPS     := gcc lame ogg ffmpeg flac # id3tag

define $(PKG)_UPDATE
    wget -q -O- 'http://sourceforge.net/projects/sox/files/sox/' | \
    $(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \
    head -1
endef

define $(PKG)_BUILD
    cd '$(1)' && ./configure \
        --host='$(TARGET)' \
        --prefix='$(PREFIX)/$(TARGET)' \
        --disable-shared
    EXEEXT=.exe $(MAKE) -s -C '$(1)' -j '$(JOBS)'
    EXEEXT=.exe $(MAKE) -C '$(1)' -j 1 install
endef
